package com.fary.validator;

import javax.validation.Constraint;
import javax.validation.Payload;

import java.lang.annotation.Documented;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import com.fary.validator.CustomerValid.List;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

@Target({TYPE})
@Retention(RUNTIME)
@Documented
@Repeatable(List.class)
@Constraint(validatedBy = {CustomerValidator.class})
public @interface CustomerValid {

    String message() default "{javax.validation.constraints.NotNull.message}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    // 投保人
    String[] clientType() default {};

    String documentType() default "documentType";

    String identityNumber() default "identityNumber";

    String customerType() default "customerType";

    String overseas() default "overseas";

    @Target({ TYPE })
    @Retention(RUNTIME)
    @Documented
    @interface List {
        CustomerValid[] value();
    }
}

